import pageination from '../../components/pageination/pageination.vue'
export default {
	data() {
		return {
			//数据
			total: 0, //总条数
			page: 1, //当前页
			size: 10, //每页显示条数
      search: '', // 查询条件
      areasList: [], //基地信息
      curIndex:-1,//选中下标
		}
	},
	components: {
		pageination
	},
	created() { //调用方法
		let that = this;
	},
	mounted() {},
	methods: { //写函数方法
		//给选中的列加背景色
		choosed:function(index){
			this.curIndex=index;
		},
		//页码切换执行方法
		pageFn: function(val, pid) {
			this.page = parseInt(val);
			//此处调列表数据接口
      this.searchTodo();
		},
		/**返回子组件用户选择的一页显示条数**/
		obtainChild: function(data) {
			this.row = data;
		},
    //预览
    preview: function(url,msg) {
      if (url == null || url == "") {
        if (msg == null || msg == "") {
          msg = "附件";
        }
        layer.msg("暂无" + msg + "！");
      } else {
        window.open(this.urls.baseUrl+ url);
      }
    },
    //搜索数据列表
    searchTodo: function() {
      let that = this;
      that.$post(
        that.urls.getCurrentExpertAreasContractPageInfo, {
          "pageNum": that.page,
          "pageSize": that.size,
          "search": that.search
        }
      )
      .then(function(res) {
        if(res.success) {
          that.areasList = res.pageInfo.list;
          that.total = res.pageInfo.total;
          that.page = res.pageInfo.pageNum;
        }
      })
    },
	}
}
